package PTA.MainXDX.ex03;

import java.util.Arrays;
import java.util.Scanner;
class Rectangle{
    private int width;
    private int length;

    public Rectangle(int width, int length) {
        this.width = width;
        this.length = length;
    }
    public int getPerimeter(){
        return (width+length)*2;
    }
    public int getArea(){
        return width*length;
    }
    @Override
    public String toString() {
        return "Rectangle [" +
                "width=" + width +
                ", length=" + length +
                ']';
    }
}
class Circle{
    private int radius;

    public Circle(int radius) {
        this.radius = radius;
    }
public int getPerimeter(){
        double s = Math.PI*2*radius;
        return (int)s;
}
public int getArea(){
        double s  = Math.PI*radius*radius;
        return (int)s;
}
    @Override
    public String toString() {
        return "Circle [" +
                "radius=" + radius +
                ']';
    }
}

public class ex03 {
    public static void main(String[] args) {
        Scanner sc=  new Scanner(System.in);
        Rectangle r[] = new Rectangle[2];
        r[0] = new Rectangle(sc.nextInt(),sc.nextInt());
        r[1] = new Rectangle(sc.nextInt(),sc.nextInt());
        Circle c[] = new Circle[2];
        c[0] = new Circle(sc.nextInt());
        c[1] = new Circle(sc.nextInt());
        System.out.println(r[0].getPerimeter()+r[1].getPerimeter()+c[0].getPerimeter()+c[1].getPerimeter());
        System.out.println(r[0].getArea()+r[1].getArea()+c[0].getArea()+c[1].getArea());
        System.out.println(Arrays.deepToString(r));
        System.out.println(Arrays.deepToString(c));
    }
}
